package com.nowcoder.community;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import javax.annotation.PostConstruct;

@SpringBootApplication
public class CommunityApplication {
    //由这个注解所标注的方法，会在构造器调用完以后被执行
    @PostConstruct
    public void init() {
        /**redis和elasticsearch的底层 都是基于Netty的，所以要解决netty启动冲突问题 */
        // 看Netty4Utils.setAvailableProcessors()
        System.setProperty("es.set.netty.runtime.available.processors", "false");
    }

    public static void main(String[] args) {
        SpringApplication.run(CommunityApplication.class, args);
    }

}
